package org.ezplatform.office.questionnaire.util;

import org.ezplatform.core.common.WebUser;

import java.util.HashMap;
import java.util.Map;

/**   
* @author 作者: wujs
* @version 创建时间：2017年12月5日 下午2:23:52 
* 类说明 
*/
public class QuestionnaireUtils {
	
	public static String getLetterByNum(int num){
		String[] letter={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
		int i = num-1;
		return letter[i];
	}


	/**
	 * create by: gly<br>
	 * description:将获取的当前用户中的数据放入map中返回
	 *    <br> userId
	 *    <br> corpId
	 *    <br> token
	 *    <br>
	 * create time: 2019/1/9 14:56<br>
	 * @params:
	 */
	public static Map<String,String> getWebUserInfo2Map(WebUser user){
		Map<String,String> returnMap = new HashMap<>();
		if(user != null){
			returnMap.put("userId",user.getUserId());
			returnMap.put("corpId",user.getCorpId());
			returnMap.put("token",user.getJwtToken());
		}
		return returnMap;
	}

}
